<template>
    <div class="login-bgc">
      <!-- 背景装饰元素 -->
      <div class="bubble"></div>
      <div class="bubble"></div>
      <div class="bubble"></div>
      <div class="bubble"></div>

      <div class="shape triangle"></div>
      <div class="shape square"></div>

      <div class="login-box">
        <h2>单词默写后台管理系统</h2>
        <div class="login">
          <form action="">
            <div class="username">
              <input type="text" name="username" placeholder="用户名">
            </div>
            <div class="password">
              <input type="text" name="password" placeholder="密码">
            </div>
            <div class="auto-code">
              <input type="text" name="autocode" placeholder="验证码">
              <span class="code"></span>
            </div>
            <button>登录</button>
          </form>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  name: "Login",
  data() {
    return {
      username: '',
      password: '',
      autoCode: ''
    };
  },
    methods: {},
};
</script>

<style lang="less" scoped>
.login-bgc {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0a7ff3, #00c6fb);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  position: relative;
  overflow: hidden;

  /* 背景装饰图形 */
  &::before, &::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
  }

  &::before {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
  }

  &::after {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
  }

  /* 浮动气泡 */
  .bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: float 15s infinite linear;

    &:nth-child(1) {
      width: 80px;
      height: 80px;
      top: 20%;
      left: 10%;
      animation-delay: 0s;
    }

    &:nth-child(2) {
      width: 120px;
      height: 120px;
      top: 60%;
      left: 15%;
      animation-delay: 2s;
    }

    &:nth-child(3) {
      width: 60px;
      height: 60px;
      top: 30%;
      right: 20%;
      animation-delay: 4s;
    }

    &:nth-child(4) {
      width: 100px;
      height: 100px;
      bottom: 20%;
      right: 10%;
      animation-delay: 6s;
    }
  }

  /* 几何图形装饰 */
  .shape {
    position: absolute;
    opacity: 0.1;

    &.triangle {
      width: 0;
      height: 0;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-bottom: 100px solid white;
      top: 10%;
      right: 15%;
      transform: rotate(45deg);
      animation: rotate 20s infinite linear;
    }

    &.square {
      width: 70px;
      height: 70px;
      background: white;
      bottom: 15%;
      left: 10%;
      transform: rotate(15deg);
      animation: pulse 8s infinite ease-in-out;
    }
  }

  .login-box {
    width: 450px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease;
    position: relative;
    z-index: 1;

    /* 其余样式保持不变... */
  }

  /* 动画定义 */
  @keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-100px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
  }

  @keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1) rotate(15deg); }
    50% { transform: scale(1.2) rotate(15deg); }
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .login-box {
    width: 450px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease;

    h2 {
      color: #0a7ff3;
      margin-bottom: 30px;
      font-weight: 600;
      font-size: 24px;
      letter-spacing: 1px;
      text-align: center;
    }

    .login {
      input {
        width: 100%;
        height: 50px;
        border: none;
        border-bottom: 2px solid #e0e0e0;
        outline: none;
        padding: 0 15px;
        font-size: 16px;
        transition: all 0.3s ease;
        background-color: transparent;

        &:focus {
          border-bottom-color: #0a7ff3;
          box-shadow: 0 2px 0 rgba(10, 127, 243, 0.2);
        }

        &::placeholder {
          color: #b0b0b0;
        }
      }

      .password {
        margin: 30px 0;
      }

      .auto-code {
        display: flex;
        margin-bottom: 10px;

        input {
          flex: 1;
          margin-right: 15px;
        }

        .code {
          width: 100px;
          height: 50px;
          background: linear-gradient(45deg, #1d79d5, #0a7ff3);
          border-radius: 6px;
          cursor: pointer;
          display: flex;
          justify-content: center;
          align-items: center;
          color: white;
          font-weight: bold;
          user-select: none;
          transition: transform 0.3s ease;

          &:hover {
            transform: scale(1.05);
          }
        }
      }

      button {
        width: 100%;
        height: 50px;
        margin-top: 30px;
        background: linear-gradient(to right, #1d79d5, #0a7ff3);
        border: none;
        color: white;
        font-size: 18px;
        font-weight: 500;
        border-radius: 25px;
        cursor: pointer;
        transition: all 0.3s ease;
        letter-spacing: 1px;

        &:hover {
          box-shadow: 0 5px 15px rgba(29, 121, 213, 0.4);
          transform: translateY(-2px);
        }

        &:active {
          transform: translateY(0);
          background: linear-gradient(to right, #0a7ff3, #1d79d5);
        }
      }
    }
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>